package com.itheima.dao;

import java.util.Scanner;

/*
* 求输入数字的索引位置
* */
public class Arr14 {
    public static void main(String[] args) {
        int []arr={23,45,32,32,56};
        int index=-1;

        Scanner sc= new Scanner(System.in);
        System.out.println("请输入您的数字");
        int num = sc.nextInt();
        for (int i = 0; i < arr.length; i++) {
            if (num==arr[i]){
                index=i;
                break;
            }
        }
        System.out.println(index);
    }
}
